var app = getApp();
import config from '@/config/config'

Component({
  data: {
    current: 0,
    index: 0,
    color: "#C4CBD9",
    selectedColor: "#0C4DF9", // 被选中颜色
    devInfo: app.globalData.isIOS,
    list: [
      {
        pagePath: '/pages/unitCheck/unitCheck',
        iconPath:  '../assets/image/unitCheck2.png',
        selectedIconPath: '../assets/image/unitCheck.png',
        text: '单位自查'
      },
      {
        pagePath: '/pages/orderList/orderList',
        iconPath:  '../assets/image/orderList2.png',
        selectedIconPath: '../assets/image/orderList.png',
        text: '工单列表'
      },
      {
        pagePath: '/pages/dataStatis/dataStatis',
        iconPath:  '../assets/image/dataStatis2.png',
        selectedIconPath: '../assets/image/dataStatis.png',
        text: '数据统计'
      },
      {
        pagePath: '/pages/personInfo/personInfo',
        iconPath:  '../assets/image/my2.png',
        selectedIconPath: '../assets/image/my.png',
        text: '个人信息'
      }
    ]
  },
  lifetimes: {
    attached() {
    },

  },

  methods: {
    switchTab(e) {
      console.log(e);
      let url = e.currentTarget.dataset.path
      let index = e.currentTarget.dataset.index
      this.getTabBar().setData({ current: index })
      if (url) {
        wx.switchTab({ url })
      }
    }
  },
});
